package com.supermap.data.dao;

import com.supermap.data.modal.TUsers;
import org.springframework.data.jpa.repository.Query;


/**
 * dao 接口
 */
public interface UserDao extends BaseInterfaceDao<TUsers,String> {

    /**
     * 根据用户名查询用户信息
     * @param username
     * @return
     */
    @Query("select o  from TUsers o where o.user_name =?1")
    public TUsers findByName(String username);

    /**
     * 登录
     * @param username
     * @param password
     * @return
     */
    @Query("select o from TUsers o where o.user_name = ?1 and o.password = ?2 and o.status > 0")
    public TUsers findByUserNameAndPassword(String username, String password);
}
